﻿namespace Sgr.EntityFrameworkCore
{
    /// <summary>
    /// EF Core DbContext提供者
    /// </summary>
    public interface IDbContextProvider<TDbContext>
        where TDbContext : UnitOfWorkDbContext
    {
        /// <summary>
        /// 获得DbContext
        /// </summary>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task<TDbContext> GetDbContextAsync(CancellationToken cancellationToken = default);
    }
}